const {
  Controller,
} = require('uni-cloud-router')

const ResponseUtil = require('../utils/Response.js')

module.exports = class UserController extends Controller {
  async info() {
    const {
      ctx,
      service,
    } = this
    const {
      openId,
    } = ctx

    return service.user.info({
      openId,
    })
  }

  async update() {
    const {
      ctx,
      service,
    } = this
    const {
      openId,
    } = ctx

    return service.user.update({
      openId,
      ...ctx.event,
    })
  }
}
